package com.shenmazong.serveraopdemo.controller;

import com.shenmazong.serveraopdemo.config.Logging;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: server-java-demo
 * @description: UserController
 * @author: 亮子说编程
 * @create: 2020-12-02 08:30
 **/

@RestController
public class UserController {

    @RequestMapping(value = "/add")
    @Logging("人员新增操作")
    public String add(String name){ //每个被拦截的方法都是连接点
        System.out.println("人员新增");
        return name  + " 人员新增";
    }

    @RequestMapping(value = "/del")
    @Logging("人员删除操作")
    public String del(String name){
        System.out.println("人员删除");
        return name + " 人员删除";
    }

    @RequestMapping(value = "/get")
    @Logging("人员查询操作")
    public String get(String name){
        System.out.println("人员查询");
        return name;
    }

    @RequestMapping(value = "/set")
    @Logging("人员修改操作")
    public String set(String name){
        System.out.println("人员修改");
        return name.toUpperCase();
    }

}
